+Wed Nov 9 16:29:42 2005 Tim Janik <timj@imendio.com>
+
+ * gtk/gtkrange.c: patch from maemo-gtk that changes GtkRange
+ to render its arrows insensitive when the adjustment is in
+ its min or max position. this makes range arrow behaviour
+ consistent with spin button behaviour. (#321056)
+
2005-11-09 Tor Lillqvist <tml@novell.com>
* gdk/gdkinternals.h
+Wed Nov 9 16:29:42 2005 Tim Janik <timj@imendio.com>
+
+ * gtk/gtkrange.c: patch from maemo-gtk that changes GtkRange
+ to render its arrows insensitive when the adjustment is in
+ its min or max position. this makes range arrow behaviour
+ consistent with spin button behaviour. (#321056)
+
2005-11-09 Tor Lillqvist <tml@novell.com>
* gdk/gdkinternals.h
gint arrow_width;
gint arrow_height;
+ gboolean arrow_insensitive = FALSE;
+
/* More to get the right clip region than for efficiency */
if (!gdk_rectangle_intersect (area, rect, &intersection))
return;
intersection.x += widget->allocation.x;
intersection.y += widget->allocation.y;
-
- if (!GTK_WIDGET_IS_SENSITIVE (range))
+
+ if (((!range->inverted && (arrow_type == GTK_ARROW_DOWN ||
+ arrow_type == GTK_ARROW_RIGHT)) ||
+ (range->inverted && (arrow_type == GTK_ARROW_UP ||
+ arrow_type == GTK_ARROW_LEFT))) &&
+ range->adjustment->value >=
+ (range->adjustment->upper - range->adjustment->page_size))
+ {
+ arrow_insensitive = TRUE;
+ }
+ else if (((!range->inverted && (arrow_type == GTK_ARROW_UP ||
+ arrow_type == GTK_ARROW_LEFT)) ||
+ (range->inverted && (arrow_type == GTK_ARROW_DOWN ||
+ arrow_type == GTK_ARROW_RIGHT))) &&
+ range->adjustment->value <= range->adjustment->lower)
+ {
+ arrow_insensitive = TRUE;
+ }
+
+ if (!GTK_WIDGET_IS_SENSITIVE (range) || arrow_insensitive)
state_type = GTK_STATE_INSENSITIVE;
else if (clicked)
state_type = GTK_STATE_ACTIVE;
state_type = GTK_STATE_PRELIGHT;
else
state_type = GTK_STATE_NORMAL;
-
- if (clicked)
+
+ if (clicked && ! arrow_insensitive)
shadow_type = GTK_SHADOW_IN;
else
shadow_type = GTK_SHADOW_OUT;
arrow_x = widget->allocation.x + rect->x + (rect->width - arrow_width) / 2;
arrow_y = widget->allocation.y + rect->y + (rect->height - arrow_height) / 2;
- if (clicked)
+ if (clicked && ! arrow_insensitive)
{
gint arrow_displacement_x;
gint arrow_displacement_y;